package com.yzion.baselib.toast

import android.view.View
import android.widget.TextView

/**
 * ZJJ
 * 定义了全局Toast的接口，在BaseApp中createToastView(context: Context): IToast方法创建Toast
 */
interface IToast {

    /**
     * 设置提示文本
     */
    fun setText(msg: String?)

    /**
     * 返回自定义Toast视图
     */
    fun getView(): View
}

//自定义全局Toast示例代码
/*
class AppToast(context: Context) : IToast {

    var text: TextView
    var v: View = LayoutInflater.from(context).inflate(R.layout.app_toast_layout, null)

    init {
        text = v.findViewById(R.id.tv_content)
    }

    override fun setMsgText(msg: String?) {
        text.text = msg
    }

    override fun getView(): View {
        return v
    }
}
 */